const TransformPages = require('uni-read-pages')
const {webpack} = new TransformPages()
module.exports = {
    // 配置路径别名
    configureWebpack: {
        devServer: {
            // 调试时允许内网穿透，让外网的人访问到本地调试的H5页面
            disableHostCheck: true,
			// "proxy": {
			// 	"/api": {
			// 		"target": "http://localhost:8081",
			// 		"secure": false,
			// 		"changeOrigin": true,
			// 		"pathRewrite":{
			// 			"/api":""
			// 		}
			// 	}
			// }
        },
		plugins: [
			new webpack.DefinePlugin({
				ROUTES: webpack.DefinePlugin.runtimeValue(() => {
					const tfPages = new TransformPages({
						includes: ['path', 'name', 'aliasPath']
					});
					return JSON.stringify(tfPages.routes)
				}, true )
			})
		]
    }
    // productionSourceMap: false,
	
}
